package com.member.common.enums;


import lombok.Getter;

import java.util.Objects;

/**
 * @author wangxin
 */
@Getter
public enum ActivityStatusEnum {
    /**
     * 待开始
     */
    BEGIN(0, "待开始"),
    /**
     * 进行中
     */
    ACTION(1, "进行中"),

    /**
     * 已结束
     */
    END( 2, "已结束"),
    ;

    private final Integer key;
    private final String desc;

    ActivityStatusEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public static ActivityStatusEnum getByKey(Integer key){
        for (ActivityStatusEnum item : ActivityStatusEnum.values()){
            if(Objects.equals(item.getKey(), key)){
                return item;
            }
        }
        return null;
    }

}
